home *** CD-ROM | disk | FTP | other *** search
- AUTOMATON*
-
- BBM
-
- This provides the basic components for a ballistic computer. Information
- is passed by 'billiard balls' bouncing around off each other & 'mirrors'.
- It is a two state automaton; both balls & mirrors are composite objects.
- The current code simply scatters balls & mirrors randomly in the window to
- demonstrate the automaton. Unlike the logical operator OR, fundamental to
- actual computers, all the processes in BBM are reversible (alter 'phase' in
- menu to see this); the Margolus neighbourhood was originally devised to
- implement such a device. Whether this could be done was a particularly
- interesting question because the actual physical laws governing all matter
- (as currently understood) are reversible, unlike most of the processes that
- we observe (like the operation of this computer, or the breaking of a
- glass); this dichotomy is explained by the second law of thermodynamics! -
- there are far more states that we perceive as disordered than ordered, thus
- the chance of a reversible process taking an arbitrary disordered state to
- an ordered one is small. You can demonstrate this for yourself; take one
- political party, place in the position of government for twelve years &
- watch what happens to the economy, employment levels, national health
- service & so on.
-
- INITIALISATION*
-
- 10DEF PROCdo
- 20*SetEval wrap off
- 30*SetEval border 255
- 40*SetEval neig margolus
- 50ENDPROC
-
- SCREEN*
-
- 10DEF PROCdo
- 20DIM buf% 256:SYS "OS_ReadVarVal","sux",buf%,256:sx%=!buf%
- 30SYS "OS_ReadVarVal","suy",buf%,256:sy%=!buf%
- 40GCOL 63 TINT 255
- 50FOR Q%=1 TO 20*sx%*sy%/(128*128)
- 60PROCmirror(RND(sx%/2)-sx%/4,RND(sy%/2)-sy%/4,RND(32),RND(2)-1)
- 70NEXT
- 80FOR Q%=1 TO 10*sx%*sy%/(128*128)
- 90PROCball(RND(sx%/2)-sx%/4,RND(sy%/2)-sy%/4,RND(4)-1)
- 100NEXT
- 110ENDPROC
- 120DEF PROCmirror(x,y,l,f)
- 130IF f THEN
- 140RECTANGLE FILL 8*x+4,8*y,8*l-1,7
- 150ELSE
- 160RECTANGLE FILL 8*x+4,8*y,7,8*l-1
- 170ENDIF
- 180ENDPROC
- 190DEF PROCball(x,y,f)
- 200CASE f OF
- 210WHEN 0:POINT 8*x,8*y:POINT 8*x+8,8*y+8
- 220WHEN 1:POINT 8*x-4,8*y-4:POINT 8*x+4,8*y+4
- 230WHEN 2:POINT 8*x+4,8*y:POINT 8*x-4,8*y+8
- 240WHEN 3:POINT 8*x,8*y+4:POINT 8*x+8,8*y-4
- 250ENDCASE
- 260ENDPROC
-
- CODE*
-
- ( READ_NEIG
- 255 SCOUNT_ALL DUP 1 = IF (OPP ==)
- 2 = IF (CELL OPP = IF (CW ==) CELL ==)
- CELL == )
-
- END*